package com.garlicts.framework.binlog.sync.listener;

import com.alibaba.otter.canal.protocol.CanalEntry.RowData;
import com.garlicts.framework.binlog.sync.canal.CanalSyncData;
import com.garlicts.framework.binlog.sync.event.EventEnum;
import com.garlicts.framework.binlog.sync.event.UpdateCanalEvent;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UpdateCanalListener extends CanalListener<UpdateCanalEvent> {

    @Autowired
    CanalSyncData canalSyncData;
    
    @Override
    public void doSync(String databaseName, String tableName, RowData rowData) {
    	
    	canalSyncData.sync(databaseName, tableName, rowData, EventEnum.UPDATE);
    	
    }
    
}
